﻿using System;
using System.Net;
using System.Threading;
using System.Net.Sockets;
using System.Text;
using Game.Lib;

namespace Game.AccessGateway
{
    class Program
    {
        private static IPEndPoint IP;
        private static UDPServer gateway;

        private static void Main(string[] args)
        {
            //example
            IP = new IPEndPoint(IPAddress.Any, UDPServer.GATEWAY);
            gateway = new UDPServer(IP);
            gateway.OnDataReceived += new UDPServer.DataReceivedHandler(gateway_DataReceived);
            gateway.Start();
        }

        static void gateway_DataReceived(DataReceivedEventArgs e)
        {
            Console.WriteLine(Utils.GetString(e.Buffer, 0));
        }
    }
}
